package com.open.basic.util;

/**
 * @author: code
 * @Date: 2024/3/8 11:11
 * @Version: V1.0
 * @description: 数字工具类
 */

public class NumberUtil {

    /**
     * 生成count位的数字类型的短信验证码
     *
     * @param count
     * @return
     */
    public static String generatedCode(int count) {
        String code = String.valueOf((int) ((Math.random() * 9 + 1) * Math.pow(10, count - 1)));
        return code;
    }

    public static String generateNumber(){
        return String.valueOf((int) ((Math.random() * 9 + 1) * Math.pow(10, 4 - 1)));
    }
}
